package com.chenyaowei.product.service.impl;

import com.chenyaowei.common.utils.DateUtils;
import com.chenyaowei.product.domain.CywProSpuCommentReply;
import com.chenyaowei.product.mapper.CywProSpuCommentReplyMapper;
import com.chenyaowei.product.service.ICywProSpuCommentReplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 商品评价回复Service业务层处理
 * 
 * @author 陈耀威
 * @date 2023-12-03
 */
@Service
public class CywProSpuCommentReplyServiceImpl implements ICywProSpuCommentReplyService 
{
    @Autowired
    private CywProSpuCommentReplyMapper cywProSpuCommentReplyMapper;

    /**
     * 查询商品评价回复
     * 
     * @param id 商品评价回复主键
     * @return 商品评价回复
     */
    @Override
    public CywProSpuCommentReply selectCywProSpuCommentReplyById(Long id)
    {
        return cywProSpuCommentReplyMapper.selectCywProSpuCommentReplyById(id);
    }

    /**
     * 查询商品评价回复列表
     * 
     * @param cywProSpuCommentReply 商品评价回复
     * @return 商品评价回复
     */
    @Override
    public List<CywProSpuCommentReply> selectCywProSpuCommentReplyList(CywProSpuCommentReply cywProSpuCommentReply)
    {
        return cywProSpuCommentReplyMapper.selectCywProSpuCommentReplyList(cywProSpuCommentReply);
    }

    /**
     * 新增商品评价回复
     * 
     * @param cywProSpuCommentReply 商品评价回复
     * @return 结果
     */
    @Override
    public int insertCywProSpuCommentReply(CywProSpuCommentReply cywProSpuCommentReply)
    {
        cywProSpuCommentReply.setCreateTime(DateUtils.getNowDate());
        return cywProSpuCommentReplyMapper.insertCywProSpuCommentReply(cywProSpuCommentReply);
    }

    /**
     * 修改商品评价回复
     * 
     * @param cywProSpuCommentReply 商品评价回复
     * @return 结果
     */
    @Override
    public int updateCywProSpuCommentReply(CywProSpuCommentReply cywProSpuCommentReply)
    {
        return cywProSpuCommentReplyMapper.updateCywProSpuCommentReply(cywProSpuCommentReply);
    }

    /**
     * 批量删除商品评价回复
     * 
     * @param ids 需要删除的商品评价回复主键
     * @return 结果
     */
    @Override
    public int deleteCywProSpuCommentReplyByIds(Long[] ids)
    {
        return cywProSpuCommentReplyMapper.deleteCywProSpuCommentReplyByIds(ids);
    }

    /**
     * 删除商品评价回复信息
     * 
     * @param id 商品评价回复主键
     * @return 结果
     */
    @Override
    public int deleteCywProSpuCommentReplyById(Long id)
    {
        return cywProSpuCommentReplyMapper.deleteCywProSpuCommentReplyById(id);
    }

    @Override
    public List<CywProSpuCommentReply> selectListByCommentIds(List<Long> commentIds) {
        return cywProSpuCommentReplyMapper.selectListByCommentIds(commentIds);
    }
}
